/***************************************************************************\
 * The Mattise Kernel														*
 * Copyright 2007 Matthew Iselin											*
 * THIS FILE is Public Domain												*
 *																			*
 * stdio.h																	*
 *																			*
 * Handles standard I/O, which is a layer of functionality over low-level	*
 * I/O routines.															*
 *																			*
\***************************************************************************/

#ifndef STDIO_H
#define STDIO_H

/*** CONSOLE I/O ***/

// print formatted output
extern "C" int printf( const char *fmt, ... );
extern "C" int kprintf( const char* fmt, ... );

// formatted data --> string
extern "C" int sprintf( char *buffer, const char *fmt, ... );

/*** FILE I/O ***/

#include <filesys.h>

// finds and opens a file
FILE fopen( const char* fn, const char* access );

// reads an arbirtary number of bytes from a file
uint_t fread( void* dest, uint_t offset, uint_t count, FILE fp );

// writes data to a file
uint_t fwrite( void* buff, uint_t offset, uint_t count, FILE fp );

// closes a file
int fclose( FILE fp );

#endif
